import ffmpeg
import json

def transfrom_format(in_file,out_file):
    ffmpeg.input(in_file).output(out_file,vcodec='libx264').overwrite_output().run()    # h264转码
    # ffmpeg.input(in_file).output(out_file,vcodec='libx265').overwrite_output().run()  # h265转码
    # ffmpeg.input(in_file).filter('scale','1280:720').output(out_file,vcodec='libx265').overwrite_output().run()   # h265 + 分辨率720P

if __name__ == "__main__":
    input_file = "../video/112.mkv"
    output_file = "test.mp4"
    transfrom_format(input_file,output_file)